@ECHO OFF & setlocal EnableDelayedExpansion

REM **********************************************************************
REM Items to be cleared selection
REM **********************************************************************

set CLR_tmp=1
set CLR_bak=1
set CLR_bin=1

REM **********************************************************************
REM Environment configure
REM **********************************************************************

set WORK=.\
set LIB=lib
set OBJ=obj
set LST=lst
set DOWNLOAD=download
set SRC=src
set SRC4CUS=lib_src

REM **********************************************************************
REM Clean specified files
REM **********************************************************************

pushd %WORK%

if "%CLR_tmp%" == "1" (
	del %WORK%\%OBJ%\*.* /f /s /q >NUL
	ECHO clean *.obj done!
	del %WORK%\%LST%\*.* /f /s /q >NUL
	ECHO clean *.lst done!
)
if "%CLR_bak%" == "1" (
	del %WORK%\*.bak /f /s /q >NUL
	ECHO clean *.bak done!
)
if "%CLR_bin%" == "1" (
	del %WORK%\%DOWNLOAD%\*.bin /f /q >NUL
	ECHO clean *.bin done!
)

popd

:end